package com.jthinker.blog.web.controller.front.error;

import com.jthinker.blog.bean.ex.ResourceNotFoundException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * User: Gang Chen
 * Date: 2015/8/6 20:28
 */
@Controller
@RequestMapping("/error")
public class ErrorController
{
    @RequestMapping("/{code}")
    public String view(@PathVariable("code") Long code)
    {
        if (code == null)
        {
            throw new ResourceNotFoundException();
        }
        return "error/" + code;
    }
}
